package com.wzh.design.flyweight.demo1;

/**
 * @description: 享元模式
 * @author: WZH
 * @time: 2021/6/21 17:39
 */
public class Client {
    public static void main(String[] args) {
        FlyweightFactory factory = new FlyweightFactory();

        Flyweight flyweightA = factory.factory(new Character('A'));
        flyweightA.operation("First Call , A State");
        System.out.println(flyweightA);

        Flyweight flyweightB = factory.factory(new Character('B'));
        flyweightB.operation("Second Call , B State");
        System.out.println(flyweightB);

        Flyweight flyweightC = factory.factory(new Character('A'));
        flyweightC.operation("Third Call , A State");
        System.out.println(flyweightC);
    }
}
